package com.yufubao.api.controller.applet.elasticsearch;

import com.yufubao.framework.result.ResponseResult;
import com.yufubao.model.dto.applet.search.SearchDto;
import com.yufubao.service.service.applet.elasticsearch.ESService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/api/yufubao/applet/search")
public class ESController {
    @Autowired
    private ESService esService;

    /***
     * applet商户搜索
     * @return
     */
    @PostMapping("search")
    public ResponseResult search(@RequestBody SearchDto searchDto) {
        log.info("applet商户搜索：{}", searchDto);
        return esService.search(searchDto);
    }
}
